package com.futureCloudMOM.core.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.futureCloudMOM.core.entity.FBaseEntity;
import com.futureCloudMOM.framework.dict.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "WMS_ERP_SourceMain", description = "源单主表")
@TableName(value = "WMS_ERP_SourceMain")
public class WmsErpSourceMain extends FBaseEntity implements Serializable {

    @NotNull(message="[发胜方类型id]不能为空")
    @ApiModelProperty("发胜方类型id")
    @TableField(value = "fromRoleTypeId")
    @Dict(dictCode = "role_type")
    private Long fromRoleTypeId;

    @ApiModelProperty("发生方id")
    @TableField(value = "fromRoleId")
    private Long fromRoleId;

    @NotNull(message="[目标方类型id]不能为空")
    @ApiModelProperty("目标方类型id")
    @TableField(value = "toRoleTypeId")
    @Dict(dictCode = "role_type")
    private Long toRoleTypeId;

    @ApiModelProperty("目标方id")
    @TableField(value = "toRoleId")
    private Long toRoleId;

    @NotNull(message="[单据类型]不能为空")
    @ApiModelProperty("单据类型")
    @TableField(value = "billType")
    @Dict(dictCode = "id",dictTable = "Basic_BillType",dictText = "billType")
    private Long billType;

    @NotBlank(message="[单据号]不能为空")
    @Size(max= 500,message="编码长度不能超过500")
    @ApiModelProperty("单据号")
    @Length(max= 500,message="编码长度不能超过500")
    @TableField(value = "billNo")
    private String billNo;

    @ApiModelProperty("单据ID")
    @TableField(value = "billID")
    private Long billID;

    @NotNull(message="[订单创建日期]不能为空")
    @ApiModelProperty("订单创建日期")
    @TableField(value = "billCreateDate")
    private Date billCreateDate;

    @Size(max= 500,message="编码长度不能超过500")
    @ApiModelProperty("备注")
    @Length(max= 500,message="编码长度不能超过500")
    @TableField(value = "remark")
    private String remark;

    @NotNull(message="[状态]不能为空")
    @ApiModelProperty("状态")
    @TableField(value = "status")
    @Dict(dictCode = "source_main")
    private Long status;

    @ApiModelProperty("源单子表数据")
    private List<WmsErpSourceSub> list;

    @ApiModelProperty("需要删除的子表Id")
    private List<Long> ids;


}

